module.exports = (app) => {
  const DataTypes = app.Sequelize;
  return app.model.define(
    "t_companycnfo",
    {
      Co_ID: {
        autoIncrement: true,
        type: DataTypes.INTEGER,
        allowNull: false,
        primaryKey: true,
      },
      Co_Name: {
        type: DataTypes.STRING(60),
        allowNull: false,
        defaultValue: "",
      },
      Co_Profile: {
        type: DataTypes.STRING(100),
        allowNull: true,
        defaultValue: "",
      },
      Co_OwnedArea: {
        type: DataTypes.STRING(60),
        allowNull: true,
        defaultValue: "",
      },
      Co_Note: {
        type: DataTypes.STRING(60),
        allowNull: true,
        defaultValue: "",
      },
      Co_ConnectionsNumber: {
        type: DataTypes.STRING(60),
        allowNull: true,
        defaultValue: "",
      },
      Co_Logo: {
        type: DataTypes.STRING(100),
        allowNull: true,
      },
      Co_Logo_Text: {
        type: DataTypes.STRING(100),
        allowNull: true,
      },
      created_at: {
        type: DataTypes.DATE,
        allowNull: true,
      },
      updated_at: {
        type: DataTypes.DATE,
        allowNull: true,
      },
      is_default: {
        type: DataTypes.TINYINT.UNSIGNED,
        allowNull: true,
        defaultValue: 0,
        comment: "默认显示项目 0=不是 1=是",
      },
    },
    {
      tableName: "t_companycnfo",
      timestamps: false,
      underscored: false,
      indexes: [
        {
          name: "PRIMARY",
          unique: true,
          using: "BTREE",
          fields: [{ name: "Co_ID" }],
        },
      ],
    }
  );
};
